package com.nantai.jiafang.nantaijiafang.nt5s.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/10/25.
 */
public class SectionsPagerAdapter extends FragmentPagerAdapter {
    private Context context2;
    private List<Fragment> fragments;
    public SectionsPagerAdapter(Context context,FragmentManager fm,List<Fragment> fragmentList) {
        super(fm);
        context2=context;
        fragments=fragmentList;
    }
    @Override
    public Fragment getItem(int position) {
        switch (position){
            case 0:
                return fragments.get(0);
            case 1:
                return fragments.get(1);
        }
        return null;
    }
    @Override
    public int getCount() {
        // Show 3 total pages.
        return 2;
    }
    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "数据查询";
            case 1:
                return "修改处理";
        }
        return null;
    }
}
